<%--
  Created by IntelliJ IDEA.
  User: 筱
  Date: 2022-10-26
  Time: 20:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="supplierAdd">
    <div>
        <label>用户编码：</label>
        <input type="text" id="v_account" value="" readonly="readonly">
    </div>

    <div>
        <label>用户名称：</label>
        <input type="text" id="v_realName" value="" readonly="readonly">
    </div>

    <div>
        <label>用户性别：</label>
        <input type="text" id="v_sex" value="" readonly="readonly">
    </div>

    <div>
        <label>出生日期：</label>
        <input type="text" Class="Wdate" id="v_birthday" value=""
               readonly="readonly" onclick="WdatePicker();">
    </div>

    <div>
        <label>创建日期：</label>
        <input type="text" Class="Wdate" id="v_createdTime" value=""
               readonly="readonly" onclick="WdatePicker();">
    </div>

    <div>
        <label>用户电话：</label>
        <input type="text" id="v_phone" value="" readonly="readonly">
    </div>

    <div>
        <label>用户角色：</label>
        <input type="text" id="v_roleName" value="" readonly="readonly">
    </div>

    <div>
        <label>用户地址：</label>
        <input type="text" id="v_address" value="" readonly="readonly">
    </div>

    </div>
</body>
<script>
    $(".viewUser").on("click",function () {
        var obj=${this};
        $.ajax({
            type:"GET",
            url:path+"/user/"+obj.attr("userid")+"/view.json",
            dataType:"json",
            success:function (result) {
                if("failed"==result){
                    alert("操作超时!");
                }else if("nodata"==result){
                    alert("没有数据!");
                }else{
                    $("#v_account").val(result.account);
                    $("#v_realName").val(result.realName);
                    if(result.sex=="1"){
                        $("#v_sex").val("女");
                    }else if(result.sex=="2"){
                        $("#v_sex").val("男")
                    }
                    $("#v_birthday").val(result.birthday);
                    $("#v_phone").val(result.phone);
                    $("#v_address").val(result.address);
                    $("#v_roleName").val(result.roleName);
                    $("#v_createdTime").val(result.createdTime);
                }
            },
            error:function (data) {
                alert("error!");
            }
        });
    });
</script>
</html>
